<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/admin_template.xhtml">

    <ui:define name="body">
    	<h:form>
    		<h:panelGroup id="comm_panel">
	    		<rich:dataTable id="ut_id" value="#{kCommentListManager.commentList}" var="e" rows="20" width="100%">
	    			<f:facet name="header">
		                <rich:datascroller renderIfSinglePage="false" />
		            </f:facet>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.type_msg}" />
	    				</f:facet>
	    				<h:outputText value="#{e.type}" title="#{messages.type_msg}" />
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.item_msg}" />
	    				</f:facet>
	    				<a href="#{facesContext.externalContext.requestContextPath}/k_item.k?itemId=#{e.itemId}" target="blank_">
	  						<img src="/#{kInitParam.imgPath}/i_#{e.itemImg.itemId}/#{e.itemImg.thumb}" width="50" height="50" />	   					
	   					</a>
	    			</rich:column>
	    			<rich:column styleClass="tac" width="5%">
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.id_msg}" />
	    				</f:facet>
	    				<h:outputText value="#{e.id}" title="#{messages.id_msg}" />
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.name_msg}" />
	    				</f:facet>
	    				<h:outputText value="#{e.name}" title="#{messages.name_msg}" />
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.created_msg}" />
	    				</f:facet>
	    				<h:outputText value="#{e.created}" styleClass="gray">
							<s:convertDateTime pattern="dd MMM yyyy HH:mm:ss"/>
						</h:outputText>
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.comment_msg}" />
	    				</f:facet>
	    				<h:outputText value="#{e.comment}" />
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="IP" />
	    				</f:facet>
	    				<h:outputText value="#{e.ipAddress}" />
	    			</rich:column>
	    			<rich:column>
	    				<f:facet name="header">
	    					<h:outputText value="#{messages.do_msg}" />
	    				</f:facet>
	    				<a:commandLink action="#{kCommentListManager.approve(e.id)}" 
							limitToList="true" reRender="comm_panel, messages" 
							rendered="#{kUser.admin}" immediate="true">
							<h:graphicImage value="#{e.approved ? '/img/cross.png' : '/img/tick.png'}" title="#{!e.approved ? messages.approve_msg : messages.block_msg}" />
						</a:commandLink>
	    			</rich:column>
	    			<f:facet name="footer">
		                <rich:datascroller for="ut_id" renderIfSinglePage="false"/>
		            </f:facet>
	    		</rich:dataTable>
    		</h:panelGroup>
    	</h:form>
    </ui:define>
</ui:composition>
